package client;

import java.io.IOException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;

import security.AsymmetricKeyEncryptor;

public class ServerData {

	private PublicKey publicKey;
	private Key symmetricKey;
	private String address;
	private int port;
	
	public ServerData(String address, int port)
	{
		this.address = address;
		this.port = port;
		try {
			publicKey = AsymmetricKeyEncryptor.getInstance().loadPubliceKey("clientdata/server/");
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (InvalidKeySpecException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public PublicKey getPublicKey() {
		return publicKey;
	}

	public void setPublicKey(PublicKey publicKey) {
		this.publicKey = publicKey;
	}

	public Key getSymmetricKey() {
		return symmetricKey;
	}

	public void setSymmetricKey(Key symmetricKey) {
		
		this.symmetricKey = symmetricKey;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

}
